;$(function() {
	var id = $("#id").val();
	getInfo(id);
})

function getInfo(id){
	   $.ajax({
        url: "/agency/remove/findById/"+id,
        type: 'GET',
        success: function(d){
        	var success = d.success;
        	 if(success==true){
        	 var data=  d.data;
        	 if(data!=null){
        		 $("#household").html(data.household);
        		 $("#address").html(data.cityName+data.countyName+data.streetName+data.detailAddress);
        		 if(data.scheduleList!=null){
        			 var html="";
                   for (var i = 0; i < data.scheduleList.length; i++) {
                	var schedule =   data.scheduleList[i];
                	html+='<span class="form-control" style="font-weight:bold;" >'+schedule.reportdate+'</span><div>'+schedule.content+'</div><br><br>';
				  }
                   $("#content").html(html);
                 }
//        		 $("#releaseTime").html(data.releaseTime);
//        		 $("#content").html(data.contentEO.content);
        		 if(data.files!=null){
           			 var img = "";
           			 var url=ctxPath+"/file/showImage/";
           			 for(var i=0;i<data.fileIds.length;i++){
           				 var temp = url+data.fileIds[i];
           				 img+='<li>'
             			+'<a href="'+temp+'" data-type="image">'
        				+'<img src="'+temp+'" alt="" width="100px;">'
        			    +'</a>'
        			    +'</li>'  ;
           			 }
           	    $("#dropzone").html(img);
           	 $('.plusview').plusview({
         		height : 400,
         		hide : "hide",
         		show : "show"
         	});
           	} 
        		 //地图
        		var map = new BMap.Map("allmap", {enableMapClick: false});
           			setTimeout(function() {		//添加延时加载。解决问题
           				console.log(data.lat,data.lon);
           			var point = new BMap.Point(data.lat,data.lon);
           			map.centerAndZoom(point,15);
           			map.addControl(new BMap.MapTypeControl({
           				mapTypes:[
           		            BMAP_NORMAL_MAP,
           		            BMAP_HYBRID_MAP
           		        ]}));
           			var marker2 = new BMap.Marker(point);  // 创建标注
           			map.addOverlay(marker2);
           			},300);
        	 }
        	}
        } 
    });
}
